# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: jaewon

from coin.strategy.mm.base.feed_arb_base import (FeedArbSubscriberHandler, FeedArbSubsystem)

from coin.exchange.binance.ws.subscriber import BinanceSubscriber
from coin.strategy.mm.feed_builder import BinanceFlowBookBuilder
from coin.strategy.mm.subscription import SubscriptionRequest
from coin.strategy.mm.base.feed import BaseFeedSubsystem

from coin.strategy.mm.feed_arb import BinanceSnapshotFeedArbFlowBookBuilder


class BinanceSnapshotFeedArbSubscriberHandler(FeedArbSubscriberHandler):
  SubscriberType = BinanceSubscriber


class BinanceSnapshotFeedArbSubsystem(FeedArbSubsystem):
  FlowBookBuilder = BinanceSnapshotFeedArbFlowBookBuilder
  FeedSubscriber = BinanceSnapshotFeedArbSubscriberHandler
  FeedSubReq = SubscriptionRequest('Spot', 'Binance', 'snapshot')

  def set_price_limit_error_callback(self, callback):
    self._price_limit_error_callback = callback
